package com.study.it.xw.service.impl;

import com.study.it.xw.dao.UserDao;
import com.study.it.xw.entity.User;
import com.study.it.xw.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserDao dao;
    @Override
    public void reg(User U) {
        dao.insertUser(U);
    }

    @Override
    public User login(String loginname, String loginpwd) {

        return dao.login(loginname,loginpwd);
    }

    @Override
    public User findById(int id) {
        return dao.selectById(id);
    }
}
